from pypinyin import pinyin,lazy_pinyin,load_phrases_dict

dict_citys = {
        "长治": [["chángzhì"]],
    }

load_phrases_dict(dict_citys)
# print(pinyin('中文'))
print(lazy_pinyin('长治'))
print(lazy_pinyin('太古'))

# -------------------------------------------------------------------------------------------------
# 元素对象测试
from DrissionPage import ChromiumPage

# 返回标签函数
def return_taf(page):
    tag_list = page.eles('x:.//div[@id="waterfall"]/div')
    return tag_list

page = ChromiumPage()
page.get('https://image.baidu.com/search/index?tn=baiduimage&ipn=r&ct=201326592&cl=2&lm=-1&st=-1&fr=&sf=1&fmq=1526269427171_R&pv=&ic=0&nc=1&z=&se=1&showtab=0&fb=0&width=&height=&face=0&istype=2&ie=utf-8&word=%E5%A3%81%E7%BA%B8')
tage_list = return_taf(page)
print(tage_list)
for tage in tage_list:
    title = tage.ele('x:./div/div/a').text
    print(title)
# --------------------------------------------------------------------------------------------------------